package com.sm.entity;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;


import java.io.Serializable;
import java.util.HashMap;

@Component
@Scope("prototype")
public class ResultMap <T> extends BaseEntity {
    private HashMap<String,T> ResultList;
    private String Message;
    private boolean IsSuccess;

    public ResultMap(){
        this.Message = "默认值";
        this.IsSuccess = true;
        this.ResultList = new HashMap<String, T>();
    }

    public HashMap<String, T> getResultList() {
        return ResultList;
    }

    public void setResultList(HashMap<String, T> resultList) {
        ResultList = resultList;
    }

    public String getMessage() {
        return Message;
    }

    public void setMessage(String message) {
        Message = message;
    }

    public boolean isSuccess() {
        return IsSuccess;
    }

    public void setSuccess(boolean success) {
        IsSuccess = success;
    }

    public void setResult(String message,T t){
        this.ResultList.put(message,t);
    }

    @Override
    public String toString() {
        return "ResultMap{" +
                "ResultList=" + ResultList +
                ", Message='" + Message + '\'' +
                ", IsSuccess=" + IsSuccess +
                '}';
    }
}
